home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
minix
/
up1510b.tgz
/
up1510b
/
src
/
commands
/
whoami.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-07-23
|
302b
|
18 lines
/* whoami - print the current user name Author: Terrence W. Holm */
#include <sys/types.h>
#include <pwd.h>
#include <stdio.h>
struct passwd *getpwuid();
main()
{
struct passwd *pw_entry;
pw_entry = getpwuid(geteuid());
if (pw_entry == NULL) exit(1);
puts(pw_entry->pw_name);
exit(0);
}